From: emellor@ewan Date: Tue, 4 Oct 2005 10:27:37 +0000 (+0100) Subject: Added some DPRINTK statements, for debugging. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16763^2~55^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=8ae9ec76309048784e98583a40fba7c577f8ec23;p=xen.git Added some DPRINTK statements, for debugging. --- 8ae9ec76309048784e98583a40fba7c577f8ec23 diff --cc linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c index c68e7f545a,c68e7f545a..4134c4d71a --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c @@@ -63,13 -63,13 +63,23 @@@ static void frontend_changed(struct xen struct backend_info *be = container_of(watch, struct backend_info, watch); ++ DPRINTK("frontend_changed: %s.\n", be->frontpath); ++ /* If other end is gone, delete ourself. */ if (node && !xenbus_exists(be->frontpath, "")) { ++ DPRINTK("Frontend has disappeared; unregistering device.\n"); device_unregister(&be->dev->dev); return; } -- if (be->blkif == NULL || be->blkif->status == CONNECTED) ++ if (be->blkif == NULL) { ++ DPRINTK("blkif is null; doing nothing.\n"); return; ++ } ++ ++ if (be->blkif->status == CONNECTED) { ++ DPRINTK("blkif is CONNECTED; doing nothing.\n"); ++ return; ++ } err = xenbus_gather(be->frontpath, "ring-ref", "%lu", &ring_ref, "event-channel", "%u", &evtchn, NULL); @@@ -132,10 -132,10 +142,11 @@@ again xenbus_dev_ok(be->dev); ++ DPRINTK("frontend_changed(%s) finished OK.\n", be->frontpath); return; -- abort: xenbus_transaction_end(1); ++ DPRINTK("frontend_changed(%s) aborted.\n", be->frontpath); } /* @@@ -152,9 -152,9 +163,13 @@@ static void backend_changed(struct xenb = container_of(watch, struct backend_info, backend_watch); struct xenbus_device *dev = be->dev; ++ DPRINTK("backend_changed: %s\n", watch->node); ++ err = xenbus_scanf(dev->nodename, "physical-device", "%li", &pdev); -- if (XENBUS_EXIST_ERR(err)) ++ if (XENBUS_EXIST_ERR(err)) { ++ DPRINTK("physical-device node exists; doing nothing.\n"); return; ++ } if (err < 0) { xenbus_dev_error(dev, err, "reading physical-device"); return; @@@ -174,6 -174,6 +189,8 @@@ } if (be->blkif == NULL) { ++ DPRINTK("be->blkif is null; creating VBD.\n"); ++ /* Front end dir is a number, which is used as the handle. */ p = strrchr(be->frontpath, '/') + 1; handle = simple_strtoul(p, NULL, 0); @@@ -197,6 -197,6 +214,11 @@@ /* Pass in NULL node to skip exist test. */ frontend_changed(&be->watch, NULL); } ++ else { ++ DPRINTK("be->blkif is non-null; doing nothing.\n"); ++ } ++ ++ DPRINTK("backend_changed(%s) finished OK.\n", watch->node); } static int blkback_probe(struct xenbus_device *dev, @@@ -218,8 -218,8 +240,10 @@@ "frontend-id", "%li", &be->frontend_id, "frontend", NULL, &frontend, NULL); -- if (XENBUS_EXIST_ERR(err)) ++ if (XENBUS_EXIST_ERR(err)) { ++ DPRINTK("blkback_probe: %s does not exist", dev->nodename); goto free_be; ++ } if (err < 0) { xenbus_dev_error(dev, err, "reading %s/frontend or frontend-id", @@@ -231,6 -231,6 +255,8 @@@ * then our bus-id is no longer valid and we need to * destroy the backend device. */ ++ DPRINTK("blkback_probe: failed to get frontend path and ID; " ++ "destroying backend device"); err = -ENOENT; goto free_be; }